from redis import StrictRedis

class Config():
    # 调试信息
    DEBUG = None

    SECERT_KEY = 'Iqi01weZAwQKGfs5xU6arKY+70CVs9CuAtVN5GLBN2x8ujtXFqHzovpHFrKl'

    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@localhost/info33"
    SQKALCHEMY_TRACK_MODIFICATIONS = False


    # 封装redis主机和端口号
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    # 设置session信息存储在redis中
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(REDIS_HOST,REDIS_PORT)  # 不指定连接的redis数据库
    SESSION_USE_SIGNER = True
    # flask内置的，指定session信息存储的有效期（86400为一天）
    PERMANET_SESSION_LIFETIME = 86400

# 开发环境
class DevelopmentConfit(Config):
    DEBUG = True

# 生产环节
class ProductionConfig(Config):
    DEBUG = False

config_dict = {
    'development' : DevelopmentConfit,
    'production' : ProductionConfig
}